package com.bckj.freshnow.goods.mapper;

import com.bckj.freshnow.goods.entity.GoodsCategory;
import com.bckj.freshnow.goods.model.GoodsCategoryResponse;
import com.bckj.freshnow.goods.model.GoodsCategoryRequest;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
 * 商品分类表(GoodsCategory)表数据库访问层
 *
 * @author makejava
 * @since 2025-04-21 16:22:23
 */
@Mapper
public interface GoodsCategoryMapper extends BaseMapper<GoodsCategory> {

    /**
      * 列表
      *
      * @param request req
      * @return list
      */
    @SelectProvider(method = "findAll" , type = GoodsCategoryProvider.class)
    List<GoodsCategoryResponse> findAll(GoodsCategoryRequest request);
    
    class GoodsCategoryProvider{
        
        public String findAll(GoodsCategoryRequest request){
            SQL sql = new SQL();
            sql.SELECT("id, name, icon, sort, status, create_time, update_time");
            sql.FROM("goods_category");
            return sql.toString();
        }
    }
}

